package com.ruoyi.project.bill.domain;

import lombok.Data;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author: yp
 * @CreateTime: 2025/7/3
 * @Description: TODO
 * @Version: 1.0
 */
@Data
public class Bill{


    //主表数据
    private BillData billData;

    //单据定义
    private String billDefine;

    public List<BillSubData> getSubBillData(String deatilName){

        List<BillSubData> subDataList = new ArrayList<>();
        List<Map<String,Object>> detailList = (List)billData.get(deatilName);
        for(Map<String,Object> detail:detailList){
            BillSubData subData = new BillSubData();
            subData.putAll(detail);
            subDataList.add(subData);
        }
        billData.put(deatilName,subDataList);
        return subDataList;
    }


}